<?php
class PackageController extends Core_Controller
{
    public function indexAction()
    {
        $this->_view->title = "Dịch vụ";
        $this->_view->activeClass = "service";
        if(count($this->_http->getArvs())>0) throw new Exception("404 not found",404);
        
         
        $modelPackage = new Model_Package();
        $this->_view->list = $modelPackage->getPackages();
    }
    
    public function viewAction()
    {
    	$this->_view->layout(false);
    	if(count($this->_http->getArvs()) != 1 ) throw new Exception("404 not found",404);
        $id = $this->_http->getParam('id');
        if($id == null) throw new Exception("404 not found",404);
        
        $modelPackage = new Model_Package();
        $result = $modelPackage->getPackage($id);
        if($result == null) throw new Exception("404 not found",404);
        $this->_view->result = $result;
    }
}